/ BBS in a Box 10
/ BBS In A Box Volume X (AMUG) (January 1994).bin / Files / Prog / U-Z / VideoToolBox.cpt / VideoToolboxSources / CardSlot.c ![]() | < prev | next > |
MacBinary | 1993-02-22 | 1.3 KB | [TEXT/KAHL] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
66% | dexvert | Compact Compressed (Unix) (archive/compact) | ext | Supported |
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, inited, Mon Feb 22 22:39:05 1993, modified Mon Feb 22 22:39:05 1993, creator Think C, type ASCII, 692 bytes "CardSlot.c" , at 0x334 382 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [KAHL] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 43 61 72 64 53 6c | 6f 74 2e 63 00 00 00 00 |..CardSl|ot.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 02 b4 00 | 00 01 7e a7 af 4c d9 a7 |........|..~..L..|
|00000060| af 4c d9 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.L......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 55 c4 00 00 |........|....U...|
|00000080| 2f 2a 20 43 61 72 64 53 | 6c 6f 74 2e 63 0d 46 69 |/* CardS|lot.c.Fi|
|00000090| 6e 64 73 20 74 68 65 20 | 66 69 72 73 74 20 4e 75 |nds the |first Nu|
|000000a0| 42 75 73 20 73 6c 6f 74 | 20 74 68 61 74 20 63 6f |Bus slot| that co|
|000000b0| 6e 74 61 69 6e 73 20 61 | 20 63 61 72 64 20 6f 66 |ntains a| card of|
|000000c0| 20 74 68 65 20 67 69 76 | 65 6e 20 6e 61 6d 65 2e | the giv|en name.|
|000000d0| 0d 52 65 74 75 72 6e 73 | 20 2d 31 20 69 66 20 74 |.Returns| -1 if t|
|000000e0| 68 65 72 65 27 73 20 6e | 6f 20 73 75 63 68 20 63 |here's n|o such c|
|000000f0| 61 72 64 2e 0d a9 20 43 | 6f 70 79 72 69 67 68 74 |ard... C|opyright|
|00000100| 20 28 63 29 20 31 39 39 | 30 20 44 65 6e 69 73 20 | (c) 199|0 Denis |
|00000110| 47 2e 20 50 65 6c 6c 69 | 0d 48 49 53 54 4f 52 59 |G. Pelli|.HISTORY|
|00000120| 3a 0d 38 2f 32 34 2f 39 | 31 09 64 67 70 09 4d 61 |:.8/24/9|1.dgp.Ma|
|00000130| 64 65 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 77 69 |de compa|tible wi|
|00000140| 74 68 20 54 48 49 4e 4b | 20 43 20 35 2e 30 2e 0d |th THINK| C 5.0..|
|00000150| 31 31 2f 32 33 2f 39 32 | 20 64 67 70 20 64 72 6f |11/23/92| dgp dro|
|00000160| 70 70 65 64 20 6f 62 73 | 6f 6c 65 74 65 20 73 75 |pped obs|olete su|
|00000170| 70 70 6f 72 74 20 66 6f | 72 20 54 48 49 4e 4b 20 |pport fo|r THINK |
|00000180| 43 20 34 2e 0d 2a 2f 0d | 23 69 6e 63 6c 75 64 65 |C 4..*/.|#include|
|00000190| 20 22 56 69 64 65 6f 54 | 6f 6f 6c 42 6f 78 2e 68 | "VideoT|oolBox.h|
|000001a0| 22 0d 0d 4f 53 45 72 72 | 20 43 61 72 64 53 6c 6f |"..OSErr| CardSlo|
|000001b0| 74 28 63 68 61 72 20 2a | 63 61 72 64 4e 61 6d 65 |t(char *|cardName|
|000001c0| 29 0d 7b 0d 09 53 70 42 | 6c 6f 63 6b 20 6d 79 53 |).{..SpB|lock myS|
|000001d0| 70 42 6c 6f 63 6b 3b 0d | 09 4f 53 45 72 72 20 65 |pBlock;.|.OSErr e|
|000001e0| 72 72 6f 72 3b 0d 09 69 | 6e 74 20 73 6c 6f 74 3b |rror;..i|nt slot;|
|000001f0| 0d 09 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 20 |..unsign|ed char |
|00000200| 6e 61 6d 65 5b 31 32 38 | 5d 3b 0d 09 0d 09 66 6f |name[128|];....fo|
|00000210| 72 28 73 6c 6f 74 3d 39 | 3b 73 6c 6f 74 3c 31 36 |r(slot=9|;slot<16|
|00000220| 3b 73 6c 6f 74 2b 2b 29 | 7b 0d 09 09 6d 79 53 70 |;slot++)|{...mySp|
|00000230| 42 6c 6f 63 6b 2e 73 70 | 53 6c 6f 74 3d 73 6c 6f |Block.sp|Slot=slo|
|00000240| 74 3b 0d 09 09 65 72 72 | 6f 72 3d 53 43 6b 43 61 |t;...err|or=SCkCa|
|00000250| 72 64 53 74 61 74 28 26 | 6d 79 53 70 42 6c 6f 63 |rdStat(&|mySpBloc|
|00000260| 6b 29 3b 0d 09 09 69 66 | 28 21 65 72 72 6f 72 29 |k);...if|(!error)|
|00000270| 7b 0d 09 09 09 6d 79 53 | 70 42 6c 6f 63 6b 2e 73 |{....myS|pBlock.s|
|00000280| 70 49 44 3d 31 3b 0d 09 | 09 09 6d 79 53 70 42 6c |pID=1;..|..mySpBl|
|00000290| 6f 63 6b 2e 73 70 52 65 | 73 75 6c 74 3d 28 6c 6f |ock.spRe|sult=(lo|
|000002a0| 6e 67 29 20 26 6e 61 6d | 65 3b 0d 09 09 09 65 72 |ng) &nam|e;....er|
|000002b0| 72 6f 72 3d 53 52 65 61 | 64 44 72 76 72 4e 61 6d |ror=SRea|dDrvrNam|
|000002c0| 65 28 26 6d 79 53 70 42 | 6c 6f 63 6b 29 3b 0d 09 |e(&mySpB|lock);..|
|000002d0| 09 09 69 66 28 21 65 72 | 72 6f 72 20 26 26 20 21 |..if(!er|ror && !|
|000002e0| 73 74 72 63 6d 70 28 63 | 61 72 64 4e 61 6d 65 2c |strcmp(c|ardName,|
|000002f0| 50 74 6f 43 73 74 72 28 | 6e 61 6d 65 29 29 29 72 |PtoCstr(|name)))r|
|00000300| 65 74 75 72 6e 20 73 6c | 6f 74 3b 0d 09 09 7d 0d |eturn sl|ot;...}.|
|00000310| 09 7d 0d 09 72 65 74 75 | 72 6e 20 2d 31 3b 09 2f |.}..retu|rn -1;./|
|00000320| 2a 20 6e 6f 20 73 75 63 | 68 20 63 61 72 64 20 2a |* no suc|h card *|
|00000330| 2f 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |/.}.....|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00000390| ff 00 ff 00 ff 00 ff 00 | ff 00 ff 00 ff 00 ff 00 |........|........|
|000003a0| ff 00 ff 00 ff ff 81 00 | c2 00 08 ff 00 00 ff 00 |........|........|
|000003b0| 0a 43 61 72 64 53 6c 6f | 74 2e 63 53 02 00 00 00 |.CardSlo|t.cS....|
|000003c0| 54 45 58 54 4b 41 48 4c | 00 00 00 00 00 00 00 00 |TEXTKAHL|........|
|000003d0| 00 00 54 45 58 54 4b 41 | 48 4c 00 00 00 00 00 00 |..TEXTKA|HL......|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 a7 e5 d5 ad 00 00 | 00 00 00 00 01 7e c2 00 |........|.....~..|
|00000400| fd ff 00 00 fd ff fe 00 | 01 ff ff fe 00 04 ff ff |........|........|
|00000410| 00 ff ff fd 00 01 ff ff | fe 00 f8 ff 02 00 ff ff |........|........|
|00000420| fe 00 01 ff ff fe 00 00 | ed 00 36 04 ff ff 00 ff |........|..6.....|
|00000430| 00 e7 ff 81 00 c2 00 fd | ff 00 00 fd ff fe 00 01 |........|........|
|00000440| ff ff fe 00 04 ff ff 00 | ff ff fd 00 01 ff ff fe |........|........|
|00000450| 00 f9 ff 03 00 00 ff ff | fe 00 01 ff ff fe 00 00 |........|........|
|00000460| c6 00 3c 05 ff 00 ff 00 | ff 00 e8 ff 81 00 c1 00 |..<.....|........|
|00000470| 01 ff ff fe 00 01 ff ff | fd 00 01 ff ff fe 00 04 |........|........|
|00000480| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 29 00 28 |...H..Mo|naco.).(|
|00000490| 00 29 02 3d 00 00 00 00 | 00 00 00 00 00 00 00 00 |.).=....|........|
|000004a0| 00 00 00 00 00 00 00 06 | 00 04 00 50 00 20 01 dd |........|...P. ..|
|000004b0| 02 3d 00 50 00 20 01 dd | 02 3d a4 aa 79 31 00 00 |.=.P. ..|.=..y1..|
|000004c0| 01 40 00 00 01 40 00 00 | 00 00 01 00 00 00 01 00 |.@...@..|........|
|000004d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 5d 6f a8 |...L...L|...2.]o.|
|000004e0| 0c 20 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |. .....2|..MPSR..|
|000004f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 5f 14 8c 00 00 |........|..._....|
+--------+-------------------------+-------------------------+--------+--------+